package com.heima.wemedia.controller.v1;

import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.media.dtos.WmMaterialDto;
import com.heima.wemedia.service.WmMaterialService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;

/**
 * @Description:
 * @Version: V1.0
 */
@RestController
@RequestMapping("/api/v1/material")
public class WmMaterialController {

    @Autowired
    WmMaterialService wmMaterialService;

    @PostMapping("upload_picture")
    public ResponseResult upload(MultipartFile multipartFile) {
        return wmMaterialService.uploadPicture(multipartFile);
    }


    @PostMapping("list")
    public ResponseResult listPage(@RequestBody WmMaterialDto dto) {
        return wmMaterialService.listPage(dto);
    }

}
